// no 2
#include <iostream>
#define SIZE 5
int gcd(int x, int y)
{
	int g;
	for (int i = 1; i <= x; ++i)
		if (x % i == 0 && y % i == 0)
			g = i;
	return g;
}
int gcd(int ss[SIZE])
{
	int g;
	g = gcd(ss[0], ss[1]);
	for (int i = 2; i < SIZE; ++i)
		g = gcd(g, ss[i]);
	return g;
}
using namespace std;
int main()
{
	int s[SIZE] = {24, 24, 36, 48, 96};
	int x, y;
	x = gcd(24, 18);
	cout << x << "\n";
	y = gcd(s);
	cout << y;
	return 0;
}